Skip to content

fix(files_sharing): apply link share password on first save#60311

Merged
pringelmann merged 2 commits into
masterfrom
fix/57011/share-password-reactivity
May 12, 2026
Merged

fix(files_sharing): apply link share password on first save#60311
pringelmann merged 2 commits into
masterfrom
fix/57011/share-password-reactivity

Conversation

@pringelmann
Copy link
Copy Markdown
Contributor

@pringelmann pringelmann commented May 11, 2026

Summary

Setting a password on a public link share doesn't always apply on the first save. The input shows a value but the create-share request drops the password; you have to toggle "Set password" off and on, or save twice, for it to stick.

The isPasswordProtected setter awaits GeneratePassword then calls $set(share, 'newPassword', ...). Because newPassword isn't on the share at observation time, this goes through Vue 2's property-addition path, which only notifies renders subscribed to the parent's __ob__.dep. Whether the field's render is in that subscriber set depends on prop-access ordering at first read. Customer/enterprise builds land on the broken side; some dev setups don't, which is why this has been hard to reproduce.

Pre-declaring newPassword on _share (with a class getter/setter) gets Vue's observer to wire it up alongside the rest of the share state. $set then writes through an existing reactive property and notifications go through its own dep.

Checklist

  • Code is properly formatted
  • Sign-off message is added to all commits
  • Tests (unit, integration, api and/or acceptance) are included
  • Screenshots before/after for front-end changes
  • Documentation (manuals or wiki) has been updated or is not required
  • Backports requested where applicable (ex: critical bugfixes)
  • Labels added where applicable (ex: bug/enhancement, 3. to review, feature component)
  • Milestone added for target branch/version (ex: 32.x for stable32)

@pringelmann pringelmann self-assigned this May 11, 2026
@pringelmann pringelmann force-pushed the fix/57011/share-password-reactivity branch from c02d642 to 34d356b Compare May 11, 2026 19:10
@pringelmann pringelmann added this to the Nextcloud 34 milestone May 11, 2026
@pringelmann pringelmann requested a review from susnux May 12, 2026 07:37
@pringelmann pringelmann marked this pull request as ready for review May 12, 2026 07:47
@pringelmann pringelmann requested a review from a team as a code owner May 12, 2026 07:47
@pringelmann pringelmann requested review from nfebe and sorbaugh and removed request for a team May 12, 2026 07:48
@come-nc
Copy link
Copy Markdown
Contributor

come-nc commented May 12, 2026

/backport to stable33

@pringelmann pringelmann force-pushed the fix/57011/share-password-reactivity branch from dc81abf to 674fa0d Compare May 12, 2026 08:06
Pre-declare newPassword on the share state so Vue 2's reactivity covers
it from the start. Without this, $set later relies on a
property-addition notification path that races with the toggle's async
setter and intermittently drops the password in certain build
environments.

Fixes: #57011
-e
Signed-off-by: Peter Ringelmann <peter.ringelmann@nextcloud.com>
-e
Signed-off-by: Peter Ringelmann <peter.ringelmann@nextcloud.com>
@pringelmann pringelmann force-pushed the fix/57011/share-password-reactivity branch from 674fa0d to 2dfa3b8 Compare May 12, 2026 08:10
@pringelmann pringelmann merged commit c359c37 into master May 12, 2026
131 checks passed
@pringelmann pringelmann deleted the fix/57011/share-password-reactivity branch May 12, 2026 11:03
@backportbot
Copy link
Copy Markdown

backportbot Bot commented May 12, 2026

The backport to stable33 failed. Please do this backport manually.

# Switch to the target branch and update it
git checkout stable33
git pull origin stable33

# Create the new backport branch
git checkout -b backport/60311/stable33

# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts, resolve them
git cherry-pick f96cf793 2dfa3b81

# Push the cherry pick commit to the remote repository and open a pull request
git push origin backport/60311/stable33

Error: Failed to check for changes with origin/stable33: No changes found in backport branch


Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports.

@pringelmann
Copy link
Copy Markdown
Contributor Author

/backport to stable32

@backportbot
Copy link
Copy Markdown

backportbot Bot commented May 12, 2026

The backport to stable32 failed. Please do this backport manually.

# Switch to the target branch and update it
git checkout stable32
git pull origin stable32

# Create the new backport branch
git checkout -b backport/60311/stable32

# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts, resolve them
git cherry-pick f96cf793 2dfa3b81

# Push the cherry pick commit to the remote repository and open a pull request
git push origin backport/60311/stable32

Error: Failed to check for changes with origin/stable32: No changes found in backport branch


Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Adding a password to a share is not effective unless saved twice

3 participants